package com.vcredit.creditcat.service;

import com.vcredit.creditcat.model.AuthSchoolInfo;
import com.vcredit.creditcat.persistence.base.AuthSchoolInfoMapper;
import com.vcredit.creditcat.util.Utility;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 **/
@Service
public class AuthSchoolInfoService {
	@Autowired
	private AuthSchoolInfoMapper mapper;

	public void insert(AuthSchoolInfo obj) {
		mapper.insert(obj);
	}

	public void update(AuthSchoolInfo obj) {
		mapper.update(obj);
	}

	public List<AuthSchoolInfo> findAll() {
		return mapper.findAll();
	}

	public List<AuthSchoolInfo> find(AuthSchoolInfo obj) {
		return mapper.find(obj);
	}

	public AuthSchoolInfo findByProccessId(Long proccessId) {
		AuthSchoolInfo obj = new AuthSchoolInfo();
		obj.setProccessId(proccessId);
		return Utility.isNullOrEmpty(mapper.find(obj)) ? null : mapper.find(obj).get(0);
	}
}